<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('中药本草列表')" />
</head>
<body class="gray-bg">
     <br>
     <div class="container-div">
        <div class="row">
            <div class="col-sm-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>本草</h5>
                    </div>
                    <div>
                        <form id="formId">
                            <div class="select-list">
                                <ul>
                                    <li>
                                        <label>名称：</label>
                                        <input type="text" name="name"/>
                                        <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                    </li>
                                    <li>
                                        <label>拼音：</label>
                                        <input type="text" name="pingYing"/>
                                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>
                    <div class="ibox-content" style="height: 500px">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span style="font-size: large;font-weight: bold">本草详解</span>
                        -----<label id="benCaoName" style="font-size: large;font-weight: bold"></label>
                    </div>
                    <div class="ibox-content" style="height: 500px">
                        <div id="rich-content" class="pre-scrollable">
                            <!-- 富文本内容将被插入到这里 -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('zy:bencao:edit')}]];
        var removeFlag = [[${@permission.hasPermi('zy:bencao:remove')}]];
        var prefix = ctx + "zy/bencao";

        $(function() {
            var options = {
                id: "bootstrap-table",
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                showFooter: false,
                showRefresh: false,
                showToggle: false,
                showSearch: false,
                showColumns: false,
                pageSize:5,
                pageList: [5,10,25], //可供选择的每页的行数（*）
                modalName: "中药本草",
                onClickRow: onClickRow,
                columns: [
                {
                    field: 'bencaoId',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'name',
                    title: '名称'
                },
                {
                    field: 'nikeName',
                    title: '其他名称'
                },
                {
                    field: 'pingYing',
                    title: '拼音'
                },
                {
                    field: 'content',
                    title: '内容',
                    visible: false
                }]
            };
            $.table.init(options);
        });

        function onClickRow(row, $element){

            document.getElementById('rich-content').innerHTML = row.content;
            document.getElementById('benCaoName').innerText=row.name;
        }


    </script>
</body>
</html>